{template modoer_header}
<div id="body">
	<div class="myhead"></div>
	<div class="mymiddle">
		<div class="myleft">
			<!--{template 'mmenu','member','member'}-->
		</div>
		<div class="myright">
			<div class="myright_top"></div>
			<div class="myright_middle">
				<h3><cite>当前操作的主题:<span class="font_2">$_G[manage_subject][name]{if $_G[manage_subject][subname]}($_G[manage_subject][subname]){/if}</span>[<a href="javascript:void(0);" onclick="item_subject_manage();">更换</a>]</cite>微站模板管理</h3>
				<div class="mainrail">
					<!--
					<ul class="optabs">
						<li class="active"><a href="">全部模板</a></li>
						<li><a href="">已购买</a></li>
						<li><a href="">免费模板</a></li>
						<li><a href="">付费模板</a></li>
					</ul>
					<div class="clear"></div>
					<div style="border-top:1px solid #eee; height:1px; width:98%; margin:0 auto;"></div>
					-->
					<!--{if $tpl_list}-->
					<ul class="template-group">
						<!--{loop $tpl_list $tpl}-->
						<li class="template-item">
							<div class="template-item-img"><img src="{img templates/weixin/$tpl[directory]/screenshot.png}" /></div>
							<p class="template-item-body">
								$tpl[name]<br />
								<!--{if $site_data[template_id]==$tpl['templateid']}-->
								<span class="font_2">正在使用</span>
								<!--{else}-->
								<button type="button" data-id="$tpl['templateid']">使用</button>
								<!--{/if}-->
							</p>
						</li>
						<!--{/loop}-->
					</ul>
					<!--{/if}-->
				</div>
			</div>
		</div>
		<div class="clear"></div>
	</div>
	<div class="mybottom"></div>
</div>
<style>
.template-group{}
.template-item {
	float: left;
	width: 190px;
	text-align: center;
}
.template-item-img img {
	text-align: center;
	width: 160px;
}
.template-item-body {
	height: 60px;
	line-height: 25px;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
	$('button[data-id]').click(function(event) {
		use_template($(this).data('id'));
	});

	function use_template(id) {
		var act = "{url weixin/member/ac/$ac/op/use}";
		$.post(act.url(), {id:id, in_ajax:1}	, function(data) {
			if(is_message(data)) {
				myAlert(data);
			} else if(data=='OK') {
				document_reload();
			} else {
				console.debug(result);
				alert('操作失败，可能网络忙碌，请稍后尝试。');
			}
		});
	}
});
</script>
<!--{eval footer();}-->